package com.sdry.service.impl.lz;

import com.sdry.mapper.lz.MaintPlanMapper;
import com.sdry.model.lz.DeviceAccount;
import com.sdry.model.lz.LzQueryCriteria;
import com.sdry.model.lz.MaintenancePlan;
import com.sdry.service.lz.MaintPlanService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName MaintPlanServiceImpl
 * @Description 维修维护计划
 * @Author lz
 * @Date 2018年9月25日 16:05:51
 * @Version 1.0
 */
@Service
@Transactional
public class MaintPlanServiceImpl implements MaintPlanService {

    @Resource
    MaintPlanMapper maintPlanMapper;

    /**
     * 新增维修维护信息
     * @param maintenancePlan
     * @return 影响行数
     */
    @Override
    public Long addMaintenancePlan(MaintenancePlan maintenancePlan) {
        return maintPlanMapper.addMaintenancePlan(maintenancePlan);
    }

    /**
     * 单个删除和批量删除
     * @param id 选中的ID
     * @return 影响行数
     */
    @Override
    public Long deleteMaintenancePlanById(long id) {
        return maintPlanMapper.deleteMaintenancePlanById(id);
    }

    /**
     * 根据ID修改维修维护信息
     * @param maintenancePlan 编辑行的数据
     * @return 影响行数
     */
    @Override
    public Long editMaintenancePlanById(MaintenancePlan maintenancePlan) {
        return maintPlanMapper.editMaintenancePlanById(maintenancePlan);
    }

    /**
     * 分页条件查询集合
     * @param criteria 分页条件
     * @return DeviceAccount
     */
    @Override
    public List<DeviceAccount> queryMaintenancePlan(LzQueryCriteria criteria) {
        return maintPlanMapper.queryMaintenancePlan(criteria);
    }

    /**
     * 分页条件查询条数
     * @param criteria 分页条件
     * @return 条数
     */
    @Override
    public int countMaintenancePlan(LzQueryCriteria criteria) {
        return maintPlanMapper.countMaintenancePlan(criteria);
    }
}
